function myInstanceof(ins, fn) {
  if ((!ins || !fn) && (fn.prototype) && (ins.__proto__)) {
    return false;
  }

  let current = ins.__proto__;
  while (current) {
    if (current === fn.prototype) {
      return true
    }
    current = current.__proto__;
  }

  return false;
}
